<!--#include file="common/header.html"-->
<body>
    <div class="container-fluid larry-wrapper">
        <div class="row">
            <div class="col-xs-12 col-sm-12 col-md-12">
                <!--头部搜索-->
                    <form class="layui-form" action="/education/admin/statsRebate/orderItem" style="display: none" id="skuForm">
                        <input type="hidden" name="_query.pid" id="queryPid">
                        <div class="layui-inline">
                            <button lay-submit class="layui-btn" lay-filter="search" id="search">查找</button>
                        </div>
                    </form>
                <!--列表-->
                <section class="panel panel-padding">
                    <div class="group-button">
                        <!--<button class="layui-btn layui-btn-small layui-btn-danger ajax-all" data-name="checkbox" data-params='{"url": "/education/admin/productSku/delete"}'>
                            <i class="iconfont">&#xe626;</i> 删除
                        </button>-->
                    </div>
                    <div id="list" class="layui-form"></div>

                    <div class="text-right" id="page"></div>
                </section>
            </div>
        </div>
    </div>

</body>
<script id="list-tpl" type="text/html"
        data-params='{"url":"/education/admin/statsRebate/orderItem","dataName":"RebateOrderItemData","pageid":"#page", "method":"post"}'>
    <table id="example" class="layui-table lay-even" data-name="RebateOrderItemData" data-tplid="list-tpl">
        <thead>
        <tr>
            <th width="30"><input type="checkbox" id="checkall" data-name="checkbox" lay-filter="check"
                                  lay-skin="primary"></th>
            <th>商品编号</th>
            <th>规格</th>
            <th>单价(元)</th>
            <th>数量（件）</th>
            <th>返利方案</th>
        </tr>
        </thead>
        <tbody>
        {{# layui.each(d.list, function(index, item){ }}
        <tr>
            <td><input type="checkbox" name="checkbox" value="{{ item.id}}" lay-skin="primary"></td>
            <td>{{ item.product_no }} </td>
            <td>{{ item.sku_name }} </td>
            <td>{{ item.product_price }} </td>
            <td>{{ item.amount || 0}} 件</td>
            <td>{{ item.rebate_name || 0}} 件</td>
            <!--<td>{{ toFix(item.totalprice)}} 元 </td>-->
        </tr>
        {{# }); }}
        </tbody>

    </table>
</script>
<script src="../js/layui/layui.js"></script>
<script type="text/javascript" src="../js/lib/jquery-1.11.2.min.js"></script>
<script type="text/javascript" src="../js/lib/rest.js"></script>
<script type="text/javascript" src="../../jsfile/jquery/jquery.form.js"></script>
<!--#include file="common/version.html"-->
<script>
    layui.use('user_list');

    function initData(){
        var p = '_query.startDate={0}&_query.endDate={1}&areaName={2}&_query.orderId={3}'
            .replace('{0}', parent.$('#queryForm input[name="_query.startDate"]').val())
            .replace('{1}', parent.$('#queryForm input[name="_query.endDate"]').val())
            .replace('{2}', parent.$('#queryForm input[name="areaName"]').val())
            .replace('{3}', getQueryString('ids'));

        var $v =
            '{"url":"/education/admin/statsRebate/orderItem","dataName":"RebateOrderItemData","pageid":"#page", "method":"post", ' +
            '"data":"orderColunm=id&orderMode=asc&'+ p +'"}';
        $("#list-tpl").attr('data-params', $v);
    }
    function toFix(a) {//console.log(a + ' ' + a.toFixed(2));
        return (a || 0) && Number(a).toFixed(2)
    }
</script>

</html>